#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
char graph[10][10] = {
        {'A', 'B', 'C', 'D'},
        {'E', 'F', 'G', 'H'},
        {'I', 'J', 'K', '/'},
        {'M', 'N', '/', 'P'},

};
int sx = 0, sy = 0;//起点的坐标
int book[10][10];//book[i][j]=1 代表地图上map[i][j]已经访问过
int n = 4;
int fx[4][2] = {{0,  1},
                {1,  0},
                {0,  -1},
                {-1, 0}};

void dfs(int x, int y) {
    cout << graph[x][y];
    book[x][y] = 1;
    for (int i = 0; i < 4; i++) {
        int dx = fx[i][0];
        int dy = fx[i][1];
        int nx = x + dx;
        int ny = y + dy;
        if (nx < 0 || nx >= n || ny < 0 || ny >= n || book[nx][ny] == 1 || graph[nx][ny] == '/')continue;
        dfs(nx, ny);

    }

}

int main() {
    dfs(0, 0);
    return 0;
}